\hypertarget{classsock_1_1http_1_1_http_server}{}\section{sock\+:\+:http\+:\+:Http\+Server Class Reference}
\label{classsock_1_1http_1_1_http_server}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}


H\+T\+T\+P服务器  




{\ttfamily \#include $<$http\+\_\+server.\+h$>$}

Inheritance diagram for sock\+:\+:http\+:\+:Http\+Server\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classsock_1_1http_1_1_http_server}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structsock_1_1http_1_1_http_server_1_1_statics}{Statics}
\begin{DoxyCompactList}\small\item\em 状态 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef boost\+::function$<$ void(const \hyperlink{namespacesock_1_1http_abc368575f73a91496777e7268d6e9041}{Http\+Request\+Ptr} \&, const \hyperlink{namespacesock_1_1http_a1e8d565c94861f483cae82faa5d90ac8}{Http\+Response\+Ptr} \&)$>$ \hyperlink{classsock_1_1http_1_1_http_server_a860fd0abc2724910c69ef3629c534b2c}{Request\+Completed\+F\+N}
\item 
typedef boost\+::function$<$ void(const \hyperlink{namespacesock_1_1http_abc368575f73a91496777e7268d6e9041}{Http\+Request\+Ptr} \&, const \hyperlink{namespacesock_1_1http_a1e8d565c94861f483cae82faa5d90ac8}{Http\+Response\+Ptr} \&, \hyperlink{classsock_1_1http_1_1_http_server_a860fd0abc2724910c69ef3629c534b2c}{Request\+Completed\+F\+N})$>$ \hyperlink{classsock_1_1http_1_1_http_server_afd6c916273b2c92b0b478722480c77b3}{Request\+Handler}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classsock_1_1http_1_1_http_server_abad0ccb06e49327aad09f5f9e18087be}{Http\+Server} (\hyperlink{namespacesock_1_1net_a2ddc58693b405832076a3d76dc133671}{sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr} connection\+Factory=\hyperlink{namespacesock_1_1net_a2ddc58693b405832076a3d76dc133671}{sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr}(new \hyperlink{classsock_1_1net_1_1_tcp_connection_factory}{sock\+::net\+::\+Tcp\+Connection\+Factory}()))
\item 
\hyperlink{classsock_1_1http_1_1_http_server_a14fb5346b90163686c1172b5a7e1b19a}{$\sim$\+Http\+Server} (void)
\item 
bool \hyperlink{classsock_1_1http_1_1_http_server_a480de2e6bc2bf1020080da6bc270f52d}{open} (const char $\ast$addr, int port, int backlog)
\begin{DoxyCompactList}\small\item\em 打开服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_a673124e65ae935396d49293dfba7a186}{run} (void)
\begin{DoxyCompactList}\small\item\em 运行服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_ab1d4688c1a099c825847260c070a9770}{stop} (void)
\begin{DoxyCompactList}\small\item\em 停止服务器 \end{DoxyCompactList}\item 
\hyperlink{classsock_1_1net_1_1_tcp_server}{sock\+::net\+::\+Tcp\+Server} \& \hyperlink{classsock_1_1http_1_1_http_server_a34320f47f8e0b53b73d391d7be5d19b1}{get\+Tcp\+Server} (void)
\begin{DoxyCompactList}\small\item\em 获取内部\+T\+C\+P服务器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_afcf96c05483817ee22bd4969bb0c7339}{set\+Session\+Factory} (\hyperlink{namespacesock_1_1http_ab40d42e06f9b067d13943821f928e62e}{Http\+Session\+Factory\+Ptr} factory)
\begin{DoxyCompactList}\small\item\em 设置\+S\+E\+S\+S\+I\+O\+N工厂 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_a631a67f2cd6d9480cde15f3cc2d8bcfd}{set\+Request\+Factory} (\hyperlink{namespacesock_1_1http_a109e52a7c286a1054ad5fe134a97ec09}{Http\+Request\+Factory\+Ptr} factory)
\begin{DoxyCompactList}\small\item\em 设置请求工厂 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_af09722646b93b373a1b79d6b9a806093}{set\+Request\+Parser} (\hyperlink{namespacesock_1_1http_a10bd924b8a80c730376bfab54559cbcf}{Http\+Request\+Parser\+Ptr} parser)
\begin{DoxyCompactList}\small\item\em 设置请求解析器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_ab0f2bba4a15f790e18d186836d660f37}{set\+Request\+Handler} (\hyperlink{classsock_1_1http_1_1_http_server_afd6c916273b2c92b0b478722480c77b3}{Request\+Handler} handler)
\begin{DoxyCompactList}\small\item\em 设置请求处理器 \end{DoxyCompactList}\item 
void \hyperlink{classsock_1_1http_1_1_http_server_a50abc26a9889ac12ca9915a58d9e53d4}{get\+Statics} (\hyperlink{structsock_1_1http_1_1_http_server_1_1_statics}{Statics} \&statics)
\begin{DoxyCompactList}\small\item\em 获取服务器状态 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classsock_1_1http_1_1_http_server_a3e611175a551b64dda26f513067e0d04}{Http\+Session}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
H\+T\+T\+P服务器 

\subsection{Member Typedef Documentation}
\hypertarget{classsock_1_1http_1_1_http_server_a860fd0abc2724910c69ef3629c534b2c}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!Request\+Completed\+F\+N@{Request\+Completed\+F\+N}}
\index{Request\+Completed\+F\+N@{Request\+Completed\+F\+N}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{Request\+Completed\+F\+N}]{\setlength{\rightskip}{0pt plus 5cm}typedef boost\+::function$<$void(const {\bf Http\+Request\+Ptr}\&, const {\bf Http\+Response\+Ptr}\&)$>$ {\bf sock\+::http\+::\+Http\+Server\+::\+Request\+Completed\+F\+N}}\label{classsock_1_1http_1_1_http_server_a860fd0abc2724910c69ef3629c534b2c}
\hypertarget{classsock_1_1http_1_1_http_server_afd6c916273b2c92b0b478722480c77b3}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!Request\+Handler@{Request\+Handler}}
\index{Request\+Handler@{Request\+Handler}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{Request\+Handler}]{\setlength{\rightskip}{0pt plus 5cm}typedef boost\+::function$<$void(const {\bf Http\+Request\+Ptr}\&, const {\bf Http\+Response\+Ptr}\&, {\bf Request\+Completed\+F\+N})$>$ {\bf sock\+::http\+::\+Http\+Server\+::\+Request\+Handler}}\label{classsock_1_1http_1_1_http_server_afd6c916273b2c92b0b478722480c77b3}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{classsock_1_1http_1_1_http_server_abad0ccb06e49327aad09f5f9e18087be}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!Http\+Server@{Http\+Server}}
\index{Http\+Server@{Http\+Server}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{Http\+Server(sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr connection\+Factory=sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr(new sock\+::net\+::\+Tcp\+Connection\+Factory()))}]{\setlength{\rightskip}{0pt plus 5cm}Http\+Server\+::\+Http\+Server (
\begin{DoxyParamCaption}
\item[{{\bf sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr}}]{connection\+Factory = {\ttfamily {\bf sock\+::net\+::\+Tcp\+Connection\+Factory\+Ptr}(new~{\bf sock\+::net\+::\+Tcp\+Connection\+Factory}())}}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_abad0ccb06e49327aad09f5f9e18087be}
\hypertarget{classsock_1_1http_1_1_http_server_a14fb5346b90163686c1172b5a7e1b19a}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!````~Http\+Server@{$\sim$\+Http\+Server}}
\index{````~Http\+Server@{$\sim$\+Http\+Server}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{$\sim$\+Http\+Server(void)}]{\setlength{\rightskip}{0pt plus 5cm}Http\+Server\+::$\sim$\+Http\+Server (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_a14fb5346b90163686c1172b5a7e1b19a}


\subsection{Member Function Documentation}
\hypertarget{classsock_1_1http_1_1_http_server_a50abc26a9889ac12ca9915a58d9e53d4}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!get\+Statics@{get\+Statics}}
\index{get\+Statics@{get\+Statics}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{get\+Statics(\+Statics \&statics)}]{\setlength{\rightskip}{0pt plus 5cm}void Http\+Server\+::get\+Statics (
\begin{DoxyParamCaption}
\item[{{\bf Statics} \&}]{statics}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_a50abc26a9889ac12ca9915a58d9e53d4}


获取服务器状态 


\begin{DoxyParams}{Parameters}
{\em statics} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1http_1_1_http_server_a34320f47f8e0b53b73d391d7be5d19b1}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!get\+Tcp\+Server@{get\+Tcp\+Server}}
\index{get\+Tcp\+Server@{get\+Tcp\+Server}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{get\+Tcp\+Server(void)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf sock\+::net\+::\+Tcp\+Server}\& sock\+::http\+::\+Http\+Server\+::get\+Tcp\+Server (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1http_1_1_http_server_a34320f47f8e0b53b73d391d7be5d19b1}


获取内部\+T\+C\+P服务器 

\hypertarget{classsock_1_1http_1_1_http_server_a480de2e6bc2bf1020080da6bc270f52d}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!open@{open}}
\index{open@{open}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{open(const char $\ast$addr, int port, int backlog)}]{\setlength{\rightskip}{0pt plus 5cm}bool Http\+Server\+::open (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{addr, }
\item[{int}]{port, }
\item[{int}]{backlog}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_a480de2e6bc2bf1020080da6bc270f52d}


打开服务器 


\begin{DoxyParams}{Parameters}
{\em addr} & 监听地址 \\
\hline
{\em port} & 监听端口 \\
\hline
{\em backlog} & 接收队列长度 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool 
\end{DoxyReturn}
\hypertarget{classsock_1_1http_1_1_http_server_a673124e65ae935396d49293dfba7a186}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!run@{run}}
\index{run@{run}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{run(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Http\+Server\+::run (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_a673124e65ae935396d49293dfba7a186}


运行服务器 

\hypertarget{classsock_1_1http_1_1_http_server_a631a67f2cd6d9480cde15f3cc2d8bcfd}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!set\+Request\+Factory@{set\+Request\+Factory}}
\index{set\+Request\+Factory@{set\+Request\+Factory}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{set\+Request\+Factory(\+Http\+Request\+Factory\+Ptr factory)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::http\+::\+Http\+Server\+::set\+Request\+Factory (
\begin{DoxyParamCaption}
\item[{{\bf Http\+Request\+Factory\+Ptr}}]{factory}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1http_1_1_http_server_a631a67f2cd6d9480cde15f3cc2d8bcfd}


设置请求工厂 


\begin{DoxyParams}{Parameters}
{\em factory} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1http_1_1_http_server_ab0f2bba4a15f790e18d186836d660f37}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!set\+Request\+Handler@{set\+Request\+Handler}}
\index{set\+Request\+Handler@{set\+Request\+Handler}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{set\+Request\+Handler(\+Request\+Handler handler)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::http\+::\+Http\+Server\+::set\+Request\+Handler (
\begin{DoxyParamCaption}
\item[{{\bf Request\+Handler}}]{handler}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1http_1_1_http_server_ab0f2bba4a15f790e18d186836d660f37}


设置请求处理器 


\begin{DoxyParams}{Parameters}
{\em factory} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1http_1_1_http_server_af09722646b93b373a1b79d6b9a806093}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!set\+Request\+Parser@{set\+Request\+Parser}}
\index{set\+Request\+Parser@{set\+Request\+Parser}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{set\+Request\+Parser(\+Http\+Request\+Parser\+Ptr parser)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::http\+::\+Http\+Server\+::set\+Request\+Parser (
\begin{DoxyParamCaption}
\item[{{\bf Http\+Request\+Parser\+Ptr}}]{parser}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1http_1_1_http_server_af09722646b93b373a1b79d6b9a806093}


设置请求解析器 


\begin{DoxyParams}{Parameters}
{\em factory} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1http_1_1_http_server_afcf96c05483817ee22bd4969bb0c7339}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!set\+Session\+Factory@{set\+Session\+Factory}}
\index{set\+Session\+Factory@{set\+Session\+Factory}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{set\+Session\+Factory(\+Http\+Session\+Factory\+Ptr factory)}]{\setlength{\rightskip}{0pt plus 5cm}void sock\+::http\+::\+Http\+Server\+::set\+Session\+Factory (
\begin{DoxyParamCaption}
\item[{{\bf Http\+Session\+Factory\+Ptr}}]{factory}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classsock_1_1http_1_1_http_server_afcf96c05483817ee22bd4969bb0c7339}


设置\+S\+E\+S\+S\+I\+O\+N工厂 


\begin{DoxyParams}{Parameters}
{\em factory} & \\
\hline
\end{DoxyParams}
\hypertarget{classsock_1_1http_1_1_http_server_ab1d4688c1a099c825847260c070a9770}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!stop@{stop}}
\index{stop@{stop}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{stop(void)}]{\setlength{\rightskip}{0pt plus 5cm}void Http\+Server\+::stop (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{classsock_1_1http_1_1_http_server_ab1d4688c1a099c825847260c070a9770}


停止服务器 



\subsection{Friends And Related Function Documentation}
\hypertarget{classsock_1_1http_1_1_http_server_a3e611175a551b64dda26f513067e0d04}{}\index{sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}!Http\+Session@{Http\+Session}}
\index{Http\+Session@{Http\+Session}!sock\+::http\+::\+Http\+Server@{sock\+::http\+::\+Http\+Server}}
\subsubsection[{Http\+Session}]{\setlength{\rightskip}{0pt plus 5cm}friend class {\bf Http\+Session}\hspace{0.3cm}{\ttfamily [friend]}}\label{classsock_1_1http_1_1_http_server_a3e611175a551b64dda26f513067e0d04}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
E\+:/git/sock/sock/http/\hyperlink{http__server_8h}{http\+\_\+server.\+h}\item 
E\+:/git/sock/src/http/\hyperlink{http__server_8cc}{http\+\_\+server.\+cc}\end{DoxyCompactItemize}
